<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<title>Easy Ajax Push - Color</title>
</h:head>
<h:body>
	<h:dataTable value="#{messageBean.textList}" var="current">
		<h:column>
			<h:outputText value="#{current.text}"
						  style="color: #{current.color};"/>
		</h:column>
	</h:dataTable>

	<hr width="100%"/>

	<h:form>
		<h:panelGrid columns="4">
			Choose a Color:
			<h:commandButton value="Red"
                                         action="#{colorBean.chooseColor}"
                                         style="color: white; background-color: red;">
				<f:setPropertyActionListener target="#{colorBean.color}" value="red"/>
			</h:commandButton>
			<h:commandButton value="Blue"
                                         action="#{colorBean.chooseColor}"
                                         style="color: white; background-color: blue;">
				<f:setPropertyActionListener target="#{colorBean.color}" value="blue"/>
			</h:commandButton>
			<h:commandButton value="Green"
                                         action="#{colorBean.chooseColor}"
                                         style="color: white; background-color: green;">
				<f:setPropertyActionListener target="#{colorBean.color}" value="green"/>
			</h:commandButton>
		</h:panelGrid>
	</h:form>
</h:body>
</html>